﻿//
//  EntryState
//
//  Created by Codyo on 2008-07-05.
//  Copyright (c) 2008 Codyo. All rights reserved.
//

import com.codyo.mobileStateMachine.MobileStateMachine;
import com.codyo.mobileStateMachine.AbstractState;
import com.codyo.data.ProblemSet;

class com.codyo.states.EntryState extends AbstractState{
	
	private var stateMachine:MobileStateMachine;
	
	private var theStage:MovieClip;
	
	function EntryState(stateMachine:MobileStateMachine){
		this.stateMachine = stateMachine;
		
		trace("entry state entered");
	}
	
	public function keypadPressed(theKey:String):Void{
		theStage = this.stateMachine.getStage();	//need to move this
		switch(theKey){
			case "keySoft1":
				trace("ENTRY - soft key 1 pressed");
				theStage.readout_txt.text = "ENTRY - soft key 1 pressed";
				break;
			case "keySoft2":
				trace("ENTRY - soft key 2 pressed");
				theStage.readout_txt.text = "ENTRY - soft key 2 pressed";
				break;
			case "key1":
				trace("ENTRY - key 1 pressed");
				theStage.readout_txt.text = "ENTRY - key 1 pressed";
				stateMachine.setState(MobileStateMachine.GAME_INIT_STATE);
				break;
			case "right":
				trace("ENTRY - key right pressed");
				theStage.readout_txt.text = "ENTRY - key right pressed";
				stateMachine.setState(MobileStateMachine.GAME_PLAY_STATE);
				break;
			case "left":
				trace("ENTRY - key left pressed");
				theStage.readout_txt.text = "ENTRY - key left pressed";
				break;
			default:
				trace("ENTRY - key press not assigned");
				theStage.readout_txt.text = "ENTRY - key not assigned pressed: "+theKey;
				break;
			
		}
	}
}